package com.yileiqian.util;

public class BigInteger implements Comparable<BigInteger> {
	private static final int LENGTH = 256;

	private int[] value = new int[LENGTH];
	private int length;
	private boolean positive = false;

	public BigInteger(Integer number) {
		init(new Long(number));
	}

	public BigInteger(Long number) {
		init(number);
	}

	private void init(Long number) {
		if (number >= 0) {
			positive = true;
		}

		length = 0;
		while (number != 0) {
			value[length] = Math.abs((int) (number % 10));
			number = number / 10;
			length++;
		}

	}

	public BigInteger add(BigInteger ov) {
		return this;
	}

	public BigInteger minus(BigInteger ov) {
		return this;
	}
	
	private void absAdd(int[] a, int aLength, int[] b, int bLength){
		int totalLength = Math.max(aLength, bLength);
		
	}
	
	private void absMinus(int[] a, int aLength, int[] b, int bLength){
		
	}
	
	public BigInteger multiply(BigInteger ov) {
		return this;
	}

	public String toString() {
		StringBuffer buffer = new StringBuffer("");
		
		if(length == 0){
			buffer.append('0');
		}
		
		if (!positive) {
			buffer.append("-");
		}

		for (int i = length - 1; i >= 0; i--) {
			buffer.append(value[i]);
		}

		return buffer.toString();
	}

	@Override
	public int compareTo(BigInteger o) {
		// TODO Auto-generated method stub
		return 0;
	}

	public static void main(String args[]) {
		System.out.println(new BigInteger(0));
		System.out.println(new BigInteger(-10000000));
		System.out.println(new BigInteger(-1000000000));
	}
}
